sql="select * from spzs where id="+cstr(id)+" order by id desc" 意思
来源:百度知道 编辑:UC知道 时间:2024/05/09 10:44:45
sql="select * from spzs where id="+cstr(id)+" order by id desc"
在ASP中是查询意思,不过我对CSTR()函数不大明白,而且这里有“+”号,而有的查询又不需要“+”号,请帮忙详细解释一下,请不要复制其他网站上的东西给我看,我看的头疼。。。。谢谢。。。请指教。
在ASP中是查询意思,不过我对CSTR()函数不大明白,而且这里有“+”号,而有的查询又不需要“+”号,请帮忙详细解释一下,请不要复制其他网站上的东西给我看,我看的头疼。。。。谢谢。。。请指教。
cstr()函数:转换成字符串变量型态
"+"号等同于"&"
不过这句是有错误的
如果ID是数值型,那么就不应该用cstr,应该用cint
如果ID是字符型,那么就应该是sql="select * from spzs where id='"+cstr(id)+"' order by id desc"
要加上单引号
CSTR()强制将ID转化为string也就是字符串类型
关于这个函数你参考一下http://bbs.51soft.com/doc/vbscript/html/vsfctCStr.htm
+号是连接前后的字符串成为一体吧,cstr是把id转换为string类型吧
sql="select * from user"
sql="select * from问题
sql="select * from sg where
sql="select * from……"
sql = "Select top 5 * from news"
sql="select top 5 news.* from 问题
sql="select * from 表名 where 字段名=' "& document.Form.Select.value" ' "
sql = "Select * From [userinfo] Where userid = '"&userid&"'" ;
sql="select top 10 * from jjh_news where news_fenlei="&Request("news_fenlei")
sql="select * from BigClass where typeid="&typeid&" order by bigclassorder"